package hash;

import java.util.*;
import java.io.*;
import hash.HashTable;
import hash.HashMapObject;

public class Hash {         
    
    public static void main(String[] args) {
        
        HashTable HT = new HashTable();
        
        try {
                BufferedReader in = new BufferedReader(new FileReader("Война и мир"));
                String str;
                while ((str = in.readLine()) != null) {//разбиваем строку на слова, фильтруя знаки препинания
                        for (int i = 0; i < str.length(); i++) {
                            char c = str.charAt(i); 
                            if ( c =='.' || c ==',' || c =='!' || c =='?' || c =='…' || c ==':' || c ==';' || c =='-' || c =='"' )
                                str = str.substring(0, i) + str.substring(i+1);
                            }
                        Scanner sc = new Scanner(str);
                        while (sc.hasNext())    HT.set_elem ( sc.next().toLowerCase() );
                }
                in.close();
        } 
        catch (IOException e) {}
        
    }
}
      

